<?php

namespace App\Console\Commands;

use Illuminate\Console\Command;
use App\Annotation\AnnotationParser;

class ScanComponent extends Command {

  private static $ANNOS = array();

  /**
   * The name and signature of the console command.
   *
   * @var string
   */
  protected $signature = 'run:scan';

  /**
   * The console command description.
   *
   * @var string
   */
  protected $description = '解析项目注解';

  /**
   * Create a new command instance.
   *
   * @return void
   */
  public function __construct() {
    parent::__construct();
  }

  /**
   * Execute the console command.
   *
   * @return mixed
   */
  public function handle() {
    $cwd = getcwd() . DIRECTORY_SEPARATOR;
    $projectPath = $cwd;
    $classPrefix = 'App';
    $scanPath = $cwd . strtolower($classPrefix);
    \PHPSpring\Application::scan($scanPath, $projectPath, $classPrefix);
  }
}
